package com.algorithms.techniques;

import java.util.Set;
//@SuppressWarnings("hiding")
public abstract class GreedyAlgorithm<I>
{
	 protected abstract  boolean checkAndSetCondition();
	 
	 protected abstract void reorderInput();
	 
	 protected abstract <I> I makeAGreedyChoice();
	 
	 protected abstract <I> void  addToGreedyOutput(I choice);
	 
	 protected abstract  void  removeChoiceFromInput();
	 
     public void solveGreedily()
     {
    	 if(checkAndSetCondition())
    		 return ;
		 reorderInput();
		 
		 I choice = makeAGreedyChoice();
		 
		 addToGreedyOutput(choice);
		 
		 removeChoiceFromInput();
		 
		 solveGreedily();
    	
     }

	
    
     
}
